home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Oct 90 / MacApp.Tech$ 10⁄12⁄90 / 2150-Re Auto open old dia-Oct90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.1 KB  |  36 lines  |  [TEXT/GEOL]

  1. Item    8319371                         8-Oct-90        09:22PDT
  2.  
  3. From:   MOOF                            Rollin, Keith A
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. Sub:    RE>Auto open old dialog u
  8.  
  9. Attn: Gateway to Internet/BITNET/UUC
  10. SentBy: Keith Rollin
  11.         Reply to:   RE>Auto open old dialog upon s
  12. Mark,
  13.  
  14. You ask,
  15.  
  16. > I want the "open old" dialog to appear automatically when my application
  17. > starts up, and also when the last open document is closed.  I can't seem
  18. > to figure out a way to do it.  Any ideas?
  19.  
  20. A way to do this is shown in TApplication.HandleFinderRequest. In
  21. IYourApplication, set fLaunchWithNewDocument to FALSE, and execute
  22.  
  23.        aCommand := DoMenuCommand(cOpen)
  24.        IF aCommand <> NIL THEN
  25.            PostCommand(aCommand);
  26.  
  27. That handles the "when I'm starting up" case. To handle the "when the last
  28. document is closed" case, override TApplication.DeleteDocument. Call the
  29. inherited method, then check gDocList. If it is empty, do the DoMenuCommand
  30. thing again.
  31.  
  32. - Keith Rollin
  33. - Apple Developer Technical Support
  34.  
  35.  
  36.